package boot.config;

import boot.servlet.MyFilter;
import boot.servlet.MyServlet;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: zhiyu
 * @Date:16:16
 * @DESC:
 */
@Configuration
public class MyRegisterBeanConfig {
//    @Bean
//    public ServletRegistrationBean servletRegistrationBean(){
//        ServletRegistrationBean<MyServlet> myServletServletRegistrationBean = new ServletRegistrationBean<>(new MyServlet(), "/my", "/one");
//        myServletServletRegistrationBean.setLoadOnStartup(1);
//        return myServletServletRegistrationBean;
//    }
//    @Bean
//    public FilterRegistrationBean filterRegistrationBean(){
//        FilterRegistrationBean<MyFilter> filterRegistrationBean = new FilterRegistrationBean<>();
//        filterRegistrationBean.setFilter(new MyFilter());
//        return filterRegistrationBean;
//    }

}
